import { memo } from 'react'
import { PreviewCard } from '@renderer/components'
import { MapDefine } from '@renderer/define'

export interface Props {
  dataSource: MapDefine[]
}

function PreviewGrid(props: Props) {
  const { dataSource } = props
  console.log('dataSource==============', dataSource)
  return (
    <div className="cell-grid column-xl_6 column-lg_5 column-md_4 column-sm_3 column-xs_2 gap_default">
      {dataSource?.map((item) => (
        <div className="grid-item" key={item.id}>
          <PreviewCard dataSource={item} />
        </div>
      ))}
    </div>
  )
}

export default memo(PreviewGrid)
